package com.example.netty.service.offside;

import com.example.netty.common.FluxQuery;
import com.example.netty.pojo.Offside;
import com.influxdb.client.InfluxDBClient;
import com.influxdb.client.WriteApiBlocking;
import com.influxdb.client.domain.WritePrecision;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OffsideServiceImpl  {
    @Autowired
    InfluxDBClient influxDBClient;

    public void addBatch(String bucketName,List<Offside> offsides){
        WriteApiBlocking writeApiBlocking = influxDBClient.getWriteApiBlocking();
        FluxQuery.addBatch(bucketName,writeApiBlocking,offsides);
    }
}
